package com.example.module_hp_white_noise.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.module_hp_white_noise.R;
import com.example.module_hp_white_noise.entity.HpWhiteNoiseEntity1;

public class HpWhiteNoiseFragment1ChildAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public int position=0;
    public HpWhiteNoiseFragment1ChildAdapter() {
        super(R.layout.item_hp_white_noise_child_1);
    }
    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setText(R.id.child_item1_name,item);
        if (position==helper.getLayoutPosition()){
            helper.setBackgroundResource(R.id.child_item1_name,R.drawable.hp_white_noise_yuanjiao_1);
            helper.setTextColor(R.id.child_item1_name, Color.parseColor("#FAFEFF"));
        }else {
            helper.setTextColor(R.id.child_item1_name, Color.parseColor("#686A8B"));
            helper.setBackgroundResource(R.id.child_item1_name,0);
        }
    }
}
